<include file="Public/header" /> 



<div class="container app">
	<include file="Public/sidebar" /> 
	<style>
		.mainCon table, #mainCon table th, #mainCon table td{
			border:0px;
			padding:10px;
		}
	</style>
	<div id="mainCon" class="mainCon">
		
		<h4>微信消息通知设置</h4>
		<div class="bk10"></div>
	
		<form action="" id='setting' method="post" class="form-horizontal form" enctype="multipart/form-data">
		<table>
			<tr>
				<th style="width:150px;"><label for="">付款佣金订单通知：</th>
				<td>
					<label><input type="radio" name="finish" value="1" <eq name="row['finish']" value="1"> checked= "true" </eq>/>开启</label>
					<label><input type="radio" name="finish" value="0" <eq name="row['finish']" value="0"> checked= "true" </eq>/>关闭</label>
				</td>
			</tr>
			<tr>
				<th style="width:150px;"><label for="">会员升级通知id：</th>
				<td>
					<input type="text" class="form-control" name="OPENTM205211943" value="<{$wxtemp['OPENTM205211943']['template_id']}>"/>
				</td>
			</tr>
			<tr>
				<th style="width:150px;"><label for="">发展下家通知：</th>
				<td>
					<label><input type="radio" name="register" value="1" <eq name="row['register']" value="1"> checked= "true" </eq>/>开启</label>
					<label><input type="radio" name="register" value="0" <eq name="row['register']" value="0"> checked= "true" </eq>/>关闭</label>
				</td>
			</tr>
			<tr>
				<th style="width:150px;"><label for="">成为会员通知id：</th>
				<td>
					<input type="text" class="form-control" name="OPENTM203264949" value="<{$wxtemp['OPENTM203264949']['template_id']}>"/>
				</td>
			</tr>
			<!-- <tr>
				<th style="width:150px;"><label for="">订单确认通知id：</th>
				<td>
					<input type="text" class="form-control" name="TM00781" value="<{$wxtemp['TM00781']['template_id']}>"/>
				</td>
			</tr> -->
		</table>
		
		<div class="alert alert-success" role="alert">
			微信消息模版说明：<br/>所在行业 消费品/消费品
			<br/>模版标题：会员升级通知，编号：OPENTM205211943
			<br/>模版标题：成为会员通知，编号：OPENTM203264949
			<!-- <br/>模版标题：订单确认通知，编号：TM00781 -->
			<br/>微信消息模版中模版id填写对应输入框
		</div>

		<div class="form-actions text-center">
			<input onclick="ajax_submit()" value="保存" class="btn btn-danger span3" />
			<!-- <input  type="button" value="重置模板消息" id="regtemp" class="btn btn-primary " /> -->
		</div>
		</form>
	</div>
</div>

<script type="text/javascript">
	
	function ajax_submit(){
		var url="<{:U('Wechats/Wxnotify')}>";
		$.post(url,$('#setting').serializeArray(),function(data){
			if(data.status == '1'){
				layer.alert(data.info,{icon: 1});
			}else{
				layer.alert(data.info,{icon: 2});
			}
			//message(data.info,data.url,data.status);
		});
	}
	


	$("#regtemp").click(function(){
		var url="<{:U('Wechats/Regwxtemplate')}>";
		layer.confirm('注意：重置前请进入微信公众号平台清空【模板消息】',function(index){
			$.post(url,'',function(r){
				//message(r.info,r.url,r.status);
			});
			layer.close(index);
		},function(index){
			layer.close(index);
		});
		return false;
	});
//-->
</script>
